package com.chixing.day12_date_factory;

import com.chixing.day04_oop.C;
import com.chixing.day04_oop.CreditAccount;
import com.chixing.day04_oop.SavingAccount;
import com.chixing.day07_abstract.Account;

public class GenericDemo {
    public static void fun1(Pointer<Integer> pointer){}
    public static void fun2(Pointer<String> pointer){}
    //?通配符 ：可以匹配任意的 泛型类型
    public static void fun3(Pointer<?> pointer){}
    //? extends Account:通配符 上限
    public static  void fun4(Pointer<? extends Account>pointer){}
    public static void main(String[] args) {
        Pointer<Account> pointer1 = new Pointer<>();
        Pointer<SavingAccount> pointer2 = new Pointer<>();
        Pointer<CreditAccount> pointer3 = new Pointer<>();

        Pointer<Integer> p1 = new Pointer<>();
        fun1(p1);

        Pointer<String> p2 = new Pointer<>();
        fun2(p2);

        fun3(p1);
        fun3(p2);
    }
}
